package session09;

import session09.compent.FontPanel;
import session09.compent.JButtonPanel;
import session09.compent.PanePanel;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class QueryPanel extends PanePanel {
    private JButtonPanel exit;
    private FontPanel txt1;
    private FontPanel txt2;

    public FontPanel getTxt1() {
        return txt1;
    }

    public void setTxt1(FontPanel txt1) {
        this.txt1 = txt1;
    }

    public QueryPanel(ATMFrame frame) {
        super(200, 225, 200);
        this.exit = new JButtonPanel("image/buttonOff.jpg", 442, 600);
        this.exit.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Container atm = frame.getContentP();
                CardLayout cardLayout = (CardLayout) atm.getLayout();
                cardLayout.show(atm, "select");
            }
        });
        this.getBackLab().add(this.exit);
        this.txt1 = new FontPanel(150, 60, 40, 450, 50);
        //this.txt1.setText("余额：1201.0元");
        this.getImgLab().add(this.txt1);
        this.txt2 = new FontPanel(150, 100, 15, 450, 50);
        this.txt2.setText("点击退出转移到选择业务界面");
        this.getImgLab().add(this.txt2);
    }
}
